package com.youzan.open.sdk.gen.v3_0_0.model;

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import com.youzan.open.sdk.model.APIParams;
import com.youzan.open.sdk.model.ByteWrapper;
import com.youzan.open.sdk.model.FileParams;
import java.util.List;
import java.util.Map;
import java.util.Date;

public class YouzanPaySinglePayParams implements APIParams, FileParams  {

    /**
     * 支付宝是否安装，使用支付宝支付时填入
     */
    private Boolean alipayInstalled;
    /**
     * 条码对应的数字：微信支付扫码、支付宝扫码 必传。
     */
    private String authCode;
    /**
     * 币种，如人民币:CNY
     */
    private String currencyCode;
    /**
     * 参与折扣金额，单位:分
     */
    private Long discountableAmount;
    /**
     * 商品描述信息
     */
    private String goodsDesc;
    /**
     * 商户号
     */
    private String mchId;
    /**
     * 支付备注
     */
    private String memo;
    /**
     * 支付结果异步通知链接，需要接收有赞支付结果的就必填
     */
    private String notifyUrl;
    /**
     * 业务订单号，必须唯一，长度<=32位
     */
    private String outBizNo;
    /**
     * 服务商商户号，对于个人开发者填个人开发者对应的商户号。
     */
    private String partnerId;
    /**
     * 支付金额，单位:分
     */
    private Long payAmount;
    /**
     * 支付渠道，包含：WX_JS:微信公众号支付
ALIPAY_WAP:支付宝WAP支付
WX_BARCODE:微信条码支付
ALIPAY_BARCODE:支付宝条码支付
     */
    private String payTool;
    /**
     * 付款方ID
     */
    private String payerId;
    /**
     * 付款方昵称
     */
    private String payerNickName;
    /**
     * 支付成功后，前端页面跳转链接，微信公众号支付和支付宝WAP支付必填
     */
    private String returnUrl;
    /**
     * 本次交易的描述
     */
    private String tradeDesc;
    /**
     * 不参与折扣金额，单位:分
     */
    private Long undiscountableAmount;
    /**
     * 有赞授权码，通过访问  https://h5.koudaitong.com/v2/common/YzAuth/get.html?redirect_url=http://www.xxx.com/receive 拿到
     */
    private String yzAuthToken;

    public void setAlipayInstalled(Boolean alipayInstalled) {
        this.alipayInstalled = alipayInstalled;
    }

    public Boolean getAlipayInstalled() {
        return this.alipayInstalled;
    }

    public void setAuthCode(String authCode) {
        this.authCode = authCode;
    }

    public String getAuthCode() {
        return this.authCode;
    }

    public void setCurrencyCode(String currencyCode) {
        this.currencyCode = currencyCode;
    }

    public String getCurrencyCode() {
        return this.currencyCode;
    }

    public void setDiscountableAmount(Long discountableAmount) {
        this.discountableAmount = discountableAmount;
    }

    public Long getDiscountableAmount() {
        return this.discountableAmount;
    }

    public void setGoodsDesc(String goodsDesc) {
        this.goodsDesc = goodsDesc;
    }

    public String getGoodsDesc() {
        return this.goodsDesc;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getMchId() {
        return this.mchId;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getMemo() {
        return this.memo;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public String getNotifyUrl() {
        return this.notifyUrl;
    }

    public void setOutBizNo(String outBizNo) {
        this.outBizNo = outBizNo;
    }

    public String getOutBizNo() {
        return this.outBizNo;
    }

    public void setPartnerId(String partnerId) {
        this.partnerId = partnerId;
    }

    public String getPartnerId() {
        return this.partnerId;
    }

    public void setPayAmount(Long payAmount) {
        this.payAmount = payAmount;
    }

    public Long getPayAmount() {
        return this.payAmount;
    }

    public void setPayTool(String payTool) {
        this.payTool = payTool;
    }

    public String getPayTool() {
        return this.payTool;
    }

    public void setPayerId(String payerId) {
        this.payerId = payerId;
    }

    public String getPayerId() {
        return this.payerId;
    }

    public void setPayerNickName(String payerNickName) {
        this.payerNickName = payerNickName;
    }

    public String getPayerNickName() {
        return this.payerNickName;
    }

    public void setReturnUrl(String returnUrl) {
        this.returnUrl = returnUrl;
    }

    public String getReturnUrl() {
        return this.returnUrl;
    }

    public void setTradeDesc(String tradeDesc) {
        this.tradeDesc = tradeDesc;
    }

    public String getTradeDesc() {
        return this.tradeDesc;
    }

    public void setUndiscountableAmount(Long undiscountableAmount) {
        this.undiscountableAmount = undiscountableAmount;
    }

    public Long getUndiscountableAmount() {
        return this.undiscountableAmount;
    }

    public void setYzAuthToken(String yzAuthToken) {
        this.yzAuthToken = yzAuthToken;
    }

    public String getYzAuthToken() {
        return this.yzAuthToken;
    }


    public Map<String, Object> toParams() {
        Map<String, Object> params = Maps.newHashMap();
        if (alipayInstalled != null) {
            params.put("alipay_installed", alipayInstalled);
        }
        if (authCode != null) {
            params.put("auth_code", authCode);
        }
        if (currencyCode != null) {
            params.put("currency_code", currencyCode);
        }
        if (discountableAmount != null) {
            params.put("discountable_amount", discountableAmount);
        }
        if (goodsDesc != null) {
            params.put("goods_desc", goodsDesc);
        }
        if (mchId != null) {
            params.put("mch_id", mchId);
        }
        if (memo != null) {
            params.put("memo", memo);
        }
        if (notifyUrl != null) {
            params.put("notify_url", notifyUrl);
        }
        if (outBizNo != null) {
            params.put("out_biz_no", outBizNo);
        }
        if (partnerId != null) {
            params.put("partner_id", partnerId);
        }
        if (payAmount != null) {
            params.put("pay_amount", payAmount);
        }
        if (payTool != null) {
            params.put("pay_tool", payTool);
        }
        if (payerId != null) {
            params.put("payer_id", payerId);
        }
        if (payerNickName != null) {
            params.put("payer_nick_name", payerNickName);
        }
        if (returnUrl != null) {
            params.put("return_url", returnUrl);
        }
        if (tradeDesc != null) {
            params.put("trade_desc", tradeDesc);
        }
        if (undiscountableAmount != null) {
            params.put("undiscountable_amount", undiscountableAmount);
        }
        if (yzAuthToken != null) {
            params.put("yz_auth_token", yzAuthToken);
        }
        return params;
    }

    public Multimap<String, ByteWrapper> toFileParams() {
        Multimap<String, ByteWrapper> params = ArrayListMultimap.create();

            return params;
    }


}